package com.jia.leetCode;

import java.util.Arrays;

/**
 * @program: Leetcode
 * @description:
 * @author: STU756
 * @create: 2020-08-24 15:31
 */
public class Pro1562 {
    public int maxCoins(int[] piles) {
        Arrays.sort(piles);
        int ans = 0;
        for(int i = 1; i <=  piles.length/ 3; ++i) {
            ans += piles[piles.length - 2 * i];
        }
        return ans;
    }
}
